<?php
/**
 *
 * @author griever
 * @version 
 */
require_once 'Base.php';

/**
 * CheckPasswordWellForm Action Helper 
 * 
 * @uses actionHelper Custom_Helper
 */
class Custom_Helper_CheckPasswordWellForm extends Dummy_Helper_Base {
	
	public function check($password)	{
		$error = null;
//		$val = new Zend_Validate_Alnum();
//		$result = $val->isValid($password);
//		if (!$result)	{
//			$error = Message::ERROR_PASSWD_MUST_ALNUM;
//		} else {
			require_once 'configs/Config.php';
			if (strlen($password) < GlobalConfig::MIN_PASSWORD_LENGTH )	{
				$error = Message::ERROR_PASSWD_LENGTH_UNSUFFICIENT;
			}
//		}
		return $error;
	}

	/**
	 * Strategy pattern: call helper as broker method
	 */
	public function direct($password) {
		// TODO Auto-generated 'direct' method
		return $this->check($password);
	}
}
